{* Smarty *}
{include file="header.tpl" name="$username's Space" loggedin="$Loggedin"}
<div class="divTopNavigation">
<table class="tableTopNavigation">
  <tr>
    <td align="left">
      {if $previous ne ""}
        <a href="{$THIS_SCRIPT}?id={$previous}">Previous</a>
      {/if}
    </td>
    <td align="right">
      {if $next ne ""}
        <a href="{$THIS_SCRIPT}?id={$next}">Next</a>
      {/if}
    </td>
  </tr>
</table>
</div>

<table width=100% class="tableSpaceContent"><tr><td>
<!-- spanColumn2 must display here before spanColumn1 -->
<span class="spanColumn2">
<div class="divBlog">
	<center>
		<b>Recent Blog Posts</b><br>
		{section name="posts" loop="$blogposts"}
			<a href="blog.php?id={$space_id}">{$blogposts[posts]}</a><br>
		{/section}<hr width="60%" align="center">
		<a href="blog.php?id={$space_id}">View this users blog</a>
	</center>
</div>
<p>&nbsp;</p><br>
<div class="divRightContent">
      <center>
	  	 {$right_content}
	  </center>	 
</div>
<div class="divFriendsList">		 
	  <hr>
	  <center>
        <b>{$username}'s Friends</b><br><br>
        <table>
          {section name="friends" loop="$friends"}
            <tr>
              <td><img src="user_uploaded/{$friends_ids[friends]}/{$icon[friends]}" alt="" 
              {$friend_iconsize[friends]}></td>
              <td><a href="space.php?id={$friends_ids[friends]}">
              {$friends[friends]}</a></td>
            </tr>
          {/section}
			<tr>
				<td colspan="2" align="center">
					<a href="profile.php?action=friendlist&amp;id={$space_id}">View all Friends</a>
				</td>
			</tr>
        </table>
      </center>
</div>
<p>&nbsp;<br>
<div class="divFriendsComments">
      <center><b>{$username}'s Comments</b><br>
      {if $isfriend ne "0" and $editable ne "1" and $approved ne "1"}
        <a href="{$THIS_SCRIPT}?action=sendcomment&id={$space_id}">Add Comment</a><br>
      {/if}
      <table width="75%" border=".3">
          {section name="comment" loop="$comment_content"}
            <tr>
              <td width="40%"><a href="space.php?id={$comment_from_id[comment]}">
              {$comment_from[comment]}</a><br><i>{$comment_date[comment]}</i><br>
              <img src="user_uploaded/{$comment_from_id[comment]}/{$friend_icon[comment]}" width="100" height="100" alt="">
		{if $editable ne "0"}
			<a href="space.php?action=deletecomment&id={$comment_id[comment]}">Delete</a>
		{/if}
		</td>
              <td>{$comment_content[comment]}</td>
            </tr>
          {/section}
        </table>
      </center>
</div>
</span>

<span class="spanColumn1"> 
<div class="divMyIcon">
      <center>
        <b>{$username}</b>{if $headline ne ""}
        <br>
        "{$headline}"
        {/if}
        <br>
        Last Login: {$lastLogin}<br>
        {if $usericon ne ""}
          <img src="user_uploaded/{$space_id}/{$usericon}" {$size}><br><br>
          <a href="profile.php?action=pics&id={$space_id}">View My Pics</a><br>
        {/if}
        {if $editable ne "0"}
          <a href="{$SCRIPT_NAME}?action=edit">Edit Your Space</a><br>
          <a href="profile.php?action=editprofile">Edit your Profile</a><br>
          <a href="pm.php?action=listmessages">View Private Messages (You have <b>{$unread_pms}</b> Unread Messages)</a><br>
          <a href="space.php?action=friendauth">View Friend Request ({$count})</a><br>
          <a href="profile.php?action=logout">Logout</a>
        {/if}
        {if $editable ne "1"}
        {if $isfriend ne "1" or $approved ne "1"}
          	<a href="space.php?action=addfriend&amp;id={$space_id}">
          	Add as Friend</a><br>
        {/if}
          <a href="profile.php?action=view&amp;id={$space_id}">View Profile</a>
          {if $isfriend ne "0" and $approved ne "1"}
            <a href="pm.php?action=send&id={$space_id}">Send Private Message</a>
            <br>
          {/if}
        {/if}
      </center>
</div>
<p>&nbsp;<br>
<div class="divMyContent"> 
      <center>{$space_content}</center>
</div>
</span>
</td></tr></table>

<div class="divBottomNavigation">
<table class="tableBottomNavigation">
  <tr>
    <td align="left">
      {if $previous ne ""}
        <a href="{$THIS_SCRIPT}?id={$previous}">Previous</a>
      {/if}
    </td>
    <td align="right">
      {if $next ne ""}
        <a href="{$THIS_SCRIPT}?id={$next}">Next</a>
      {/if}
    </td>
  </tr>
</table>
</div>

{include file="footer.tpl"}
